/**
 * @author luolinila
 * @time 2025/3/5 18:56
 */
public class Solution {
    public String breakPalindrome(String palindrome) {
        if (palindrome.length() <= 1) {
            return "";
        }
        char[] chars = palindrome.toCharArray();
        String out = "";
        for (int i = 0; i < chars.length; i++) {
            if(chars[i] > 'a') {
                char temp = chars[i];
                chars[i] = 'a';
                if(chars[i] == chars[chars.length - i - 1]) {
                    chars[i] = temp;
                    break;
                }
                out = new String(chars);
                return out;
            }
        }
        chars[chars.length - 1] = 'b';
        out = new String(chars);
        return out;
    }
}
